"""
类和对象
"""

# 定义类
class Clock:
    # 属性
    id = None
    prince = None
    # 方法
    def ring(self):
        import winsound
        print(f"闹钟{self.id}响了，起床啦！")
        winsound.Beep(2000,3000)

# 创建对象
clock1 = Clock()
clock1.id = "001"
clock1.prince = 199.9
print(f"闹钟编号：{clock1.id},价格：{clock1.prince}")
clock1.ring()
clock2 = Clock()
clock2.id = "002"
clock2.prince = 19.9
print(f"闹钟编号：{clock2.id},价格：{clock2.prince}")
clock2.ring()
